package com.coocaa.launcher.framework.manager.setting;

import com.coocaa.launcher.framework.manager.setting.CPUInfos.CPUInfo;

public class DeviceManager {
    private static DeviceManager instance = null;

    public static DeviceManager getInstance() {
        if (instance == null) {
            instance = new DeviceManager();
        }
        return instance;
    }

    private DeviceManager() {

    }

    public String getSDK() {
        return getAndroidSDK(DeviceInfo.sdkVersion());
    }

    public String getManufactory() {
        return DeviceInfo.getManufactory();
    }

    public String getModule() {
        return DeviceInfo.deviceModel();
    }

    public String getPix() {
        return DeviceInfo.getPIX();
    }

    public String getMac() {
        return DeviceInfo.getMAC();
    }

    public String getCPU() {
        return CPUInfos.getCpuType();
    }

    public int getCPUCount() {
        return CPUInfos.getCpuCount();
    }

    public CPUInfo getCPUInfo() {
        return CPUInfos.getCPUInfo();
    }

    public String getIpInfo() {
        return DeviceInfo.getIPInfo();
    }

    public float getTotalSize() {
        return DeviceInfo.getTotalInternalMemorySize();
    }

    public float getAvialSize() {
        return DeviceInfo.getAvailableInternalMemorySize();
    }

    public long getTotalMemory() {
        return DeviceInfo.getTotalMemory();
    }

    public String getAndroidSDK(int s) {
        if (s < 14)
            return "android 4.0 以下版本";
        String androidSDK = "";
        switch (s) {
            case 14:
                androidSDK = "4.0";
                break;
            case 15:
                androidSDK = "4.0.3";
                break;
            case 16:
                androidSDK = "4.1.2";
                break;
            case 17:
                androidSDK = "4.2.2";
                break;
            case 18:
                androidSDK = "4.3";
                break;
            case 19:
                androidSDK = "4.4.2";
                break;
            case 20:
                break;
            case 21:
                break;
        }
        return androidSDK;
    }
}
